﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JMT.Data;
using JMT.Controls.TreeNodes;

namespace JMT.Controls
{
    public static class JTreeNodeFactory
    {
        public static JTreeNode Create(JModel jModel)
        {
            if (jModel is JSolution)
            {
                return new JSolutionTreeNode(jModel as JSolution);
            }
            else if (jModel is JPackage)
            {
                return new JPackageTreeNode(jModel as JPackage);
            }
            else if (jModel is JDiagram)
            {
                return new JDiagramTreeNode(jModel as JDiagram);
            }
            else if (jModel is JClass)
            {
                return new JClassTreeNode(jModel as JClass);
            }
            else if (jModel is JInterface)
            {
                return new JInterfaceTreeNode(jModel as JInterface);
            }
            return new JTreeNode(jModel);
        }
    }
}
